import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/common.css'
import directives from "@/directive";

let app = createApp(App);
// 全局安装组件
app.use(router).use(store).use(ElementPlus);

//安装所有的自定义指令
for (let directivesKey in directives) {
    console.log(directivesKey)
    app.directive(directivesKey,directives[directivesKey]);
}

// app.directive(directive., {
//     // 当被绑定的元素挂载到 DOM 中时……
//     mounted(el) {
//         // 聚焦元素
//         el.focus()
//     }
// })
app.mount('#app');